package com.liuhouse1.controller;

import com.liuhouse1.model.Student;
import com.liuhouse1.service.StudentService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


//这是属于springMVC的注解  所以这里必须引入 spring-boot-start-web依赖
@RestController
public class DubboController {

    @DubboReference(interfaceClass = StudentService.class , version = "1.0")
    private StudentService studentService;

    @GetMapping("/query")
    public String queryStudent(Integer id){
        Student student = studentService.queryStudent(id);
        return "调用远程接口,获取对象:" + student;
    }

}
